from flask import Blueprint
import json
from config import Config

api_bp = Blueprint('api', __name__, url_prefix='/api')

def load_json_data(filename):
    try:
        with open(filename, 'r', encoding='utf-8') as file:
            return json.load(file)
    except FileNotFoundError:
        return {"error": "File not found"}, 404
    except json.JSONDecodeError:
        return {"error": "Invalid JSON format"}, 500

# 导入各个子模块
from . import messages, regions